/**
 * Created by liuyanjun on 2017/6/26.
 */
import App from "../App.vue"
const home = r => require.ensure([], () => r(require('../view/book/home/home.vue')), 'home')
const login = r => require.ensure([], () => r(require('../view/book/login/login.vue')), 'login')
const search=r=> require.ensure([],() => r(require('../view/book/search/search.vue')),'search')
const community = r=> require.ensure([], () => r(require('../view/book/community/community.vue')),'community')
const find = r=> require.ensure([], () => r(require('../view/book/find/find.vue')),'find')

export default [{
    path:'/',
    component:App,//顶级路由，对应index.html
    children:[//二级路由，对应app.vue
      //地址为空时，跳转home页面
      {
        path:'',
        redirect:'/home'
      },
      //首页
      {
       path:'/home',
       component:home
      },
        //登录注册页
        {
          path:'/login',
            component:login
        },
        //搜索页
        {
            path:'/search',
            component:search
        },
        //社区
        {
            path:'/community',
            component:community
        },
        //发现
        {
            path:'/find',
            component:find
        }
    ]
}]
